package cn.shopping.core.daomanager.immutable.impl;

import cn.shopping.common.daomanager.impl.CommonDaoManagerImpl;
import cn.shopping.core.daomanager.immutable.ImmutableGoodsDaoManager;
import cn.shopping.core.dbo.GoodsDO;
import cn.shopping.core.mapper.GoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 代码自动生成，请不要修改，切记！！！
 */
public class ImmutableGoodsDaoManagerImpl extends CommonDaoManagerImpl<GoodsDO,Long> implements ImmutableGoodsDaoManager {

        @Autowired
        private GoodsMapper goodsMapper;




        @PostConstruct
        private void init(){
           super.setCommonMapper(goodsMapper);

            Map<String,String> fieldMap=new HashMap<>();
            fieldMap.put(GoodsDO.ID,GoodsDO.DB_ID);
            fieldMap.put(GoodsDO.DB_ID,GoodsDO.DB_ID);

            fieldMap.put(GoodsDO.GMT_CREATE,GoodsDO.DB_GMT_CREATE);
            fieldMap.put(GoodsDO.DB_GMT_CREATE,GoodsDO.DB_GMT_CREATE);

            fieldMap.put(GoodsDO.GMT_MODIFIED,GoodsDO.DB_GMT_MODIFIED);
            fieldMap.put(GoodsDO.DB_GMT_MODIFIED,GoodsDO.DB_GMT_MODIFIED);

            fieldMap.put(GoodsDO.IS_DELETED,GoodsDO.DB_IS_DELETED);
            fieldMap.put(GoodsDO.DB_IS_DELETED,GoodsDO.DB_IS_DELETED);

            fieldMap.put(GoodsDO.TITLE,GoodsDO.DB_TITLE);
            fieldMap.put(GoodsDO.DB_TITLE,GoodsDO.DB_TITLE);

            fieldMap.put(GoodsDO.DESCRIBE,GoodsDO.DB_DESCRIBE);
            fieldMap.put(GoodsDO.DB_DESCRIBE,GoodsDO.DB_DESCRIBE);

            fieldMap.put(GoodsDO.PRICE,GoodsDO.DB_PRICE);
            fieldMap.put(GoodsDO.DB_PRICE,GoodsDO.DB_PRICE);



            super.setFieldNameMap(fieldMap);
        }



        public List<GoodsDO> listByTitle(String title, String... fieldNames){
            return this.goodsMapper.listByTitle(title,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Map<Long,GoodsDO> mapByTitle(String title, String... fieldNames){
            return this.goodsMapper.mapByTitle(title,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Integer countByTitle(String title){
            return this.goodsMapper.countByTitle(title);
        }

        public Integer updateNotNullFieldsByTitle(GoodsDO updateDO, String title){
            if (super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateNotNullFieldsByTitle(updateDO,title);
        }

        public Integer updateAllFieldsByTitle(GoodsDO updateDO,  String title){
            if (super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateAllFieldsByTitle(updateDO,title);
        }

        public Integer deleteByTitle( String title){
            return this.goodsMapper.deleteByTitle(title);
        }



        public List<GoodsDO> listByInTitle(Collection<String> titleList, String... fieldNames){
            return this.goodsMapper.listByInTitle(titleList,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Map<Long,GoodsDO> mapByInTitle(Collection<String> titleList, String... fieldNames){
            return this.goodsMapper.mapByInTitle(titleList,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Integer countByInTitle(Collection<String> titleList){
            return this.goodsMapper.countByInTitle(titleList);
        }

        public Integer updateNotNullFieldsByInTitle(GoodsDO updateDO, Collection<String> titleList){
            if(super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateNotNullFieldsByInTitle(updateDO,titleList);
        }

        public Integer updateAllFieldsByInTitle(GoodsDO updateDO,  Collection<String> titleList){
            if(super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateAllFieldsByInTitle(updateDO,titleList);
        }

        public Integer deleteByInTitle( Collection<String> titleList){
            return this.goodsMapper.deleteByInTitle(titleList);
        }


        public List<GoodsDO> listByDescribe(String describe, String... fieldNames){
            return this.goodsMapper.listByDescribe(describe,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Map<Long,GoodsDO> mapByDescribe(String describe, String... fieldNames){
            return this.goodsMapper.mapByDescribe(describe,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Integer countByDescribe(String describe){
            return this.goodsMapper.countByDescribe(describe);
        }

        public Integer updateNotNullFieldsByDescribe(GoodsDO updateDO, String describe){
            if (super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateNotNullFieldsByDescribe(updateDO,describe);
        }

        public Integer updateAllFieldsByDescribe(GoodsDO updateDO,  String describe){
            if (super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateAllFieldsByDescribe(updateDO,describe);
        }

        public Integer deleteByDescribe( String describe){
            return this.goodsMapper.deleteByDescribe(describe);
        }



        public List<GoodsDO> listByInDescribe(Collection<String> describeList, String... fieldNames){
            return this.goodsMapper.listByInDescribe(describeList,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Map<Long,GoodsDO> mapByInDescribe(Collection<String> describeList, String... fieldNames){
            return this.goodsMapper.mapByInDescribe(describeList,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Integer countByInDescribe(Collection<String> describeList){
            return this.goodsMapper.countByInDescribe(describeList);
        }

        public Integer updateNotNullFieldsByInDescribe(GoodsDO updateDO, Collection<String> describeList){
            if(super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateNotNullFieldsByInDescribe(updateDO,describeList);
        }

        public Integer updateAllFieldsByInDescribe(GoodsDO updateDO,  Collection<String> describeList){
            if(super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateAllFieldsByInDescribe(updateDO,describeList);
        }

        public Integer deleteByInDescribe( Collection<String> describeList){
            return this.goodsMapper.deleteByInDescribe(describeList);
        }


        public List<GoodsDO> listByPrice(Double price, String... fieldNames){
            return this.goodsMapper.listByPrice(price,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Map<Long,GoodsDO> mapByPrice(Double price, String... fieldNames){
            return this.goodsMapper.mapByPrice(price,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Integer countByPrice(Double price){
            return this.goodsMapper.countByPrice(price);
        }

        public Integer updateNotNullFieldsByPrice(GoodsDO updateDO, Double price){
            if (super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateNotNullFieldsByPrice(updateDO,price);
        }

        public Integer updateAllFieldsByPrice(GoodsDO updateDO,  Double price){
            if (super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateAllFieldsByPrice(updateDO,price);
        }

        public Integer deleteByPrice( Double price){
            return this.goodsMapper.deleteByPrice(price);
        }



        public List<GoodsDO> listByInPrice(Collection<Double> priceList, String... fieldNames){
            return this.goodsMapper.listByInPrice(priceList,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Map<Long,GoodsDO> mapByInPrice(Collection<Double> priceList, String... fieldNames){
            return this.goodsMapper.mapByInPrice(priceList,super.javaFieldNames2DataBaseNames(fieldNames));
        }

        public Integer countByInPrice(Collection<Double> priceList){
            return this.goodsMapper.countByInPrice(priceList);
        }

        public Integer updateNotNullFieldsByInPrice(GoodsDO updateDO, Collection<Double> priceList){
            if(super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateNotNullFieldsByInPrice(updateDO,priceList);
        }

        public Integer updateAllFieldsByInPrice(GoodsDO updateDO,  Collection<Double> priceList){
            if(super.doChecker != null){
                super.doChecker.checkWhenModify(updateDO);
            }
            return this.goodsMapper.updateAllFieldsByInPrice(updateDO,priceList);
        }

        public Integer deleteByInPrice( Collection<Double> priceList){
            return this.goodsMapper.deleteByInPrice(priceList);
        }


}

